package com.abocode.aichat.app.vo;

import com.abocode.aichat.app.constant.SuccessCode;
import com.abocode.aichat.app.utils.EncryptionUtils;
import lombok.Data;

import java.text.SimpleDateFormat;
import java.util.Date;

/***
 * Created by guanxf on 2015/12/16.
 */
@Data
public class BaseResponse {
	public String status;
	private String  message;
	public String time;

	public BaseResponse(String status,String message) {
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//24小时制
		this.status = status;
		this.message=message;
		this.time =sdf.format(new Date());

	}

	public BaseResponse(String status,String  message, String  time) {
		this.status = status;
		this.time = time;
		this.message=message;
	}

	public static Object success() {
		return EncryptionUtils.toBody(new BaseResponse(SuccessCode.SUCCESS,SuccessCode.MESSAGE));
	}
}
